#version 450

layout(location = 0) in vec3 inPosition;
layout(location = 1) in vec3 inNormal;
layout(location = 2) in vec3 inTangent;
layout(location = 3) in vec3 inBitangent;
layout(location = 4) in vec2 inTexC;

layout (binding = 0) uniform UBO 
{
	mat4 projection;
	mat4 model;
	mat4 view;
	vec3 camPos;
} ubo;

layout (location = 0) out vec3 outWorldPos;
layout (location = 1) out vec3 outNormal;
layout (location = 2) out vec3 outTangent;
layout (location = 3) out vec3 outBitangent;
layout (location = 4) out vec2 outUV;

out gl_PerVertex 
{
	vec4 gl_Position;
};

void main() 
{
	outWorldPos = vec3(ubo.model * vec4(inPosition, 1.0));
	outNormal = mat3(ubo.model) * inNormal;
	outTangent = mat3(ubo.model) * inTangent;
	outBitangent = mat3(ubo.model) * inBitangent;
	outUV = inTexC;
	// outUV.t = 1.0 - inTexC.t;

	gl_Position =  ubo.projection * ubo.view * vec4(outWorldPos, 1.0);
}
